package com.huashizhaoxi.lionapp.dao;

import com.huashizhaoxi.lionapp.entity.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProductMapper {
    @Select("select * from product")
    List<Product> getAllProduct();

    @Select("select * from product where product_name like concat('%', #{keyword}, '%') or product_desc like concat('%', #{keyword}, '%')")
    List<Product> searchProduct(String keyword);

    @Delete("delete from product where id = #{id}")
    int deleteProduct(Integer id);
}
